#include "ProblemsContainerBase.h"

ProblemsContainerBase::ProblemsContainerBase()
{
	m_name = "UNKNOWN";
}

ProblemsContainerBase::~ProblemsContainerBase()
{
}

bool ProblemsContainerBase::Shutdown()
{
	return true;
}

const std::string& ProblemsContainerBase::GetName() const
{
	return m_name;
}

RetType ProblemsContainerBase::SolveProblem(const UInt i_problemNumber) const
{
	ProblemMap::const_iterator cit= m_problemMap.find(i_problemNumber);
	if(cit == m_problemMap.end())
		return UNIMPLEMENTED;
	return (cit->second)();
}

void ProblemsContainerBase::RegisterFunc(Register& o_register, const UInt i_number, ProblemFunctor i_functor)
{ 
	o_register.insert(std::pair<UInt, ProblemsContainerBase*>(i_number, this));
	m_problemMap[i_number] = i_functor;
}

